Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ WIP - Reconcile Machines & Managed Security Groups #1765

Closed
wants to merge 1 commit into from

Conversation

EmilienM
Copy link
Contributor

@EmilienM EmilienM commented Nov 29, 2023

What this PR does / why we need it:

Before this patch, if Managed Security Groups would be enabled,
CAPO would create them and the OpenStack Machines would get these
security groups at instance creation time.

Now, we are updating the ports of the machines to ensure they match the
desired security groups that we want assigned.

For now we only have Control Plane & Worker Security groups but in the
future we'll have Bastion, CNI and also an interface to add more
Security Groups.

We'll need to reconcile the machines to ensure they have the security
group assigned.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 29, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: EmilienM
Once this PR has been reviewed and has the lgtm label, please assign jichenjc for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

netlify bot commented Nov 29, 2023

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit a0a0657
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/6568f4c631c21500084a1478
😎 Deploy Preview https://deploy-preview-1765--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 29, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 29, 2023
@EmilienM EmilienM marked this pull request as draft November 29, 2023 21:24
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 30, 2023
@EmilienM EmilienM changed the title WIP - changes to security group reconcile WIP - Reconcile Machines & Managed Security Groups Nov 30, 2023
@EmilienM EmilienM changed the title WIP - Reconcile Machines & Managed Security Groups ✨ WIP - Reconcile Machines & Managed Security Groups Nov 30, 2023
@EmilienM EmilienM marked this pull request as ready for review November 30, 2023 18:46
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2023
@EmilienM
Copy link
Contributor Author

EmilienM commented Nov 30, 2023

  • I'm missing the watch on the controller to watch for OpenStackMachine events, this will likely make CI failing I guess
  • We probably need a dedicated controller for managed security groups, with watches on both cluster & machines
  • Conversion was not easy so for now I'm adding the API to v6 & v5. Of course I'll remove it and handle proper conversion

Before this patch, if Managed Security Groups would be enabled,
CAPO would create them and the OpenStack Machines would get these
security groups at instance creation time.

Now, we are updating the ports of the machines to ensure they match the
desired security groups that we want assigned.

For now we only have Control Plane & Worker Security groups but in the
future we'll have Bastion, CNI and also an interface to add more
Security Groups.

We'll need to reconcile the machines to ensure they have the security
group assigned.
@k8s-ci-robot
Copy link
Contributor

@EmilienM: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-openstack-test a0a0657 link true /test pull-cluster-api-provider-openstack-test
pull-cluster-api-provider-openstack-e2e-test a0a0657 link true /test pull-cluster-api-provider-openstack-e2e-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@@ -110,6 +110,9 @@ type OpenStackMachineStatus struct {
// +optional
InstanceState *InstanceState `json:"instanceState,omitempty"`

// SecurityGroups is the list of security groups IDs associated with this machine.
SecurityGroups []string `json:"securityGroups,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

um... I think for new features we tend to only on latest API ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this was just for getting a build. Like I wrote in a comment above, I couldn't get the conversion working yet so I did this.

BTW I think this whole patch will go away, I was just experimenting a bit.
Now I believe a new controller is much preferred.

@EmilienM EmilienM closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants